<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>OA管理系统</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--&lt;!&ndash; Font Awesome &ndash;&gt;-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--&lt;!&ndash; Ionicons &ndash;&gt;-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=e9c5bb62">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=66b457d6">
    <style type="text/css">
        html {
            overflow: hidden;
        }
        .appDown{
            color: rgba(255,255,255,0.8);;
            cursor: pointer;
            position: relative;
            padding: 0 10px;
        }
        .appDown img{
            position: absolute;
            left: 0px;
            top: 50px;
            border: 2px solid #ddd;
            display: none;
        }

        .appDown:hover img{
            display: block;
        }
    </style>
    <!--[if lt IE 9]>
    <!--<script src="/plugins/ie9/html5shiv.min.js"></script>-->
    <!--<script src="/plugins/ie9/respond.min.js"></script>-->
    <![endif]-->
</head>
<body class="hold-transition skin-blue sidebar-mini fixed">
<div class="wrapper">

    <header class="main-header">
        <!-- Logo -->
        <a class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-lg"><i class="fa fa-angle-double-left" data-toggle="offcanvas" role="button" style="color: #fff;font-size: 18px;margin-left: 104px;margin-top: 28px;"></i></span>
            <span class="logo-mini"><i class="fa fa-angle-double-right" data-toggle="offcanvas" role="button" style="color: #fff;font-size: 18px;"></i></span>
            <!-- logo for regular state and mobile devices -->
            <!--<span class="logo-lg text-left"><img src="../dist/img/logoTwo.png" alt=""><b>工作OA</b></span>-->
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <div class="content-tabs">
                <!--<button class="roll-nav roll-left tabLeft" onclick="scrollTabLeft()">-->
                <!--<i class="fa fa-backward"></i>-->
                <!--</button>-->
                <nav class="page-tabs menuTabs tab-ui-menu" id="tab-menu " >
                    <div class="page-tabs-content" style="margin-left: 0px;">

                    </div>
                </nav>
                <!--<button class="roll-nav roll-right tabRight" onclick="scrollTabRight()">-->
                <!--<i class="fa fa-forward" style="margin-left: 3px;"></i>-->
                <!--</button>-->
                <!--<div class="btn-group roll-nav roll-right">-->
                <!--<button class="dropdown tabClose" data-toggle="dropdown">-->
                <!--页签操作<i class="fa fa-caret-down" style="padding-left: 3px;"></i>-->
                <!--</button>-->
                <!--<ul class="dropdown-menu dropdown-menu-right" style="min-width: 128px;">-->
                <!--<li><a class="tabReload" href="javascript:refreshTab();">刷新当前</a></li>-->
                <!--<li><a class="tabCloseCurrent" href="javascript:closeCurrentTab();">关闭当前</a></li>-->
                <!--<li><a class="tabCloseAll" href="javascript:closeOtherTabs(true);">全部关闭</a></li>-->
                <!--<li><a class="tabCloseOther" href="javascript:closeOtherTabs();">除此之外全部关闭</a></li>-->
                <!--</ul>-->
                <!--</div>-->
                <ul class="nav navbar-nav" style="position: absolute;right: 40px;top:0px; background-color: #4796e5;">
                    <li class="appDown"><a><i class="fa  fa-mobile"></i>&nbsp;APP下载 <img  alt="扫码下载" src="/dist/img/appDown.png"></a></li>
                    <!-- User Account: style can be found in dropdown.less -->
                    <li class="dropdown user user-menu">
                        <a id="person" class="dropdown-toggle" data-toggle="dropdown" style="cursor: pointer;">
                            <i class="fa  fa-user"></i>&nbsp;
                            <span class="loginName"> </span><span class="minNo">、欢迎登录！</span>
                        </a>
                    </li>
                    <!-- Control Sidebar Toggle Button -->
                    <li>
                        <a id="aExit" data-toggle="control-sidebar" style="cursor: pointer;"><i class="fa  fa-power-off"></i>&nbsp;&nbsp;退出</a>
                    </li>
                </ul>
                <button id="maxBtn" class="roll-nav roll-right fullscreen" onclick="App.handleFullScreen()"><i
                        class="fa fa-arrows-alt" ></i></button>

            </div>

        </nav>

    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!--<div class="toggle">-->
            <!--<div class="max">-->
            <!--<div class="text" style="margin-right: 50px;"> 功能导航</div>-->
            <!--<i class="fa fa-angle-double-left" data-toggle="offcanvas" role="button" style="color: #228bee;font-size: 18px;"></i>-->
            <!--</div>-->
            <!--<div class="min">-->
            <!--<i class="fa fa-angle-double-right" data-toggle="offcanvas" role="button" style="color: #228bee;font-size: 18px;margin-left: 20px;"></i>-->

            <!--</div>-->
            <!--&lt;!&ndash; Sidebar toggle button&ndash;&gt;-->

            <!--</div>-->
            <!-- /.search form -->
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu">

            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper" id="content-wrapper" style="min-height: 421px;">
        <!--bootstrap tab风格 多标签页-->

        <div class="content-iframe " style="background-color: #ffffff; ">
            <div class="tab-content " id="tab-content">

            </div>
        </div>
    </div>
    <!-- /.content-wrapper -->

    <!--<footer class="main-footer">-->
    <!--<div class="pull-right hidden-xs">-->
    <!--<b>Version</b> 2.3.8-->
    <!--</div>-->
    <!--<strong>Copyright &copy; 2014-2016 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights-->
    <!--reserved.-->
    <!--</footer>-->

    <!-- Control Sidebar -->

    <!-- /.control-sidebar -->
    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script><script>window.jQuery || document.write('<script src="/dist/plugins/jQuery/jquery-2.2.3.min.js"><\/script>','<script src="/dist/plugins/bootstrap/js/bootstrap.min.js"><\/script>','<script src="/dist/plugins/vue/vue.min.js"><\/script>')</script>
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/plugins/jQuery/jquery.cookie.min.js"></script>
<script src="/dist/js/oa.js?t=63aed32f"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script type="text/javascript">
    /**
     * 本地搜索菜单
     */
//    $(".loginName").click(function () {
//        console.log(getCurrentUser())
//        $.dialog({
//            content: 'url:entry.html?id=' + getCurrentUser().id + '&pageType=look',
//            title: getCurrentUser().userName+"详情",
//            width: 904,
//            height: 613,
//            max: true,
//            min: true,
//            lock: true
//        }).max();
//    });
    function search_menu() {
        //要搜索的值
        var text = $('input[name=q]').val();

        var $ul = $('.sidebar-menu');
        $ul.find("a.nav-link").each(function () {
            var $a = $(this).css("border","");

            //判断是否含有要搜索的字符串
            if ($a.children("span.menu-text").text().indexOf(text) >= 0) {

                //如果a标签的父级是隐藏的就展开
                $ul = $a.parents("ul");

                if ($ul.is(":hidden")) {
                    $a.parents("ul").prev().click();
                }

                //点击该菜单
                $a.click().css("border","1px solid");

//                return false;
            }
        });
    }

    $(function () {
        $("#aExit").click(function () {
            setCurrentUser(null);
            $.cookie("loginTel",null);
            $.cookie("loginPwd",null);
            window.location = "/page/login.html?t=" + new Date();
        })
        $("#person").click(function () {
            // location.href="http://localhost:8000/page/personnel/entry.html?id="+getCurrentUser().id+"&pageType=look";
            url = "personnel/entry.html";
            top.closeTabByPageId("bfkh-detail");
            top.addTabs({
                id: "bfkh-detail",
                title: '个人详情',
                close: true,
                url: url + '?id=' + getCurrentUser().id+ "&pageType=look"
            });

        });

        $(".loginName").text(getCurrentUser().name+"-"+getCurrentUser().roleName);
//        console.log(window.location);

        App.setbasePath("../");
        App.setGlobalImgPath("dist/img/");

        addTabs({
            id: '10008',
            title: '个人主页',
            close: false,
            url: '/welcome_iframe.html',
            urlType: "relative"
        });

        App.fixIframeCotent();

        function menuFormat(data) {
            var i, l,
                key = "id",
                parentKey = "parentId",
                childKey = "children";
            if (!key || key == "" || !data) return [];

            var r = [];
            var tmpMap = [];
            for (i = 0, l = data.length; i < l; i++) {
                tmpMap[data[i][key]] = data[i];
            }
            for (i = 0, l = data.length; i < l; i++) {
                if (tmpMap[data[i][parentKey]] && data[i][key] != data[i][parentKey]) {
                    if (!tmpMap[data[i][parentKey]][childKey])
                        tmpMap[data[i][parentKey]][childKey] = [];
                    tmpMap[data[i][parentKey]][childKey].push(data[i]);
                } else {
                    r.push(data[i]);
                }
            }
            console.log(r);
            return r;
        }
        var menus="";
        $.ajax({
            url:server.ip + '/right/getMenuByUserId.json',
            data:JSON.stringify({
                userId:getCurrentUser().id,
                rightType:1,
                companyBloom:getCurrentUser().companyBloom
//                userId:getCurrentUser().id
            }),
            type:'POST',
            dataType:'json',
            contentType: 'application/json;charset=utf-8',
            success:function (r) {
                console.log(r.data.sendData)
                menus=menuFormat(r.data.sendData);
                $('.sidebar-menu').sidebarMenu({data: menus});
            }
        });
//        console.log(menus)
        var menus = [
            {
                id: "9000",
                text: "header",
                icon: "",
                isHeader: true
            },
            {
                id: "9001",
                text: "UI Elements",
                icon: "fa fa-laptop",
                children: [
                    {
                        id: "90011",
                        text: "buttons",
                        icon: "fa fa-circle-o",
                        url: "UI/buttons_iframe.html",
                        targetType: "iframe-tab"
                    },
                    {
                        id: "90012",
                        text: "icons",
                        url: "UI/icons_iframe.html",
                        targetType: "iframe-tab",
                        icon: "fa fa-circle-o"
                    },
                    {
                        id: "90013",
                        text: "general",
                        url: "UI/general_iframe.html",
                        targetType: "iframe-tab",
                        icon: "fa fa-circle-o"
                    },
                    {
                        id: "90014",
                        text: "modals",
                        url: "UI/modals_iframe.html",
                        targetType: "iframe-tab",
                        icon: "fa fa-circle-o"
                    },
                    {
                        id: "90015",
                        text: "sliders",
                        url: "UI/sliders_iframe.html",
                        targetType: "iframe-tab",
                        icon: "fa fa-circle-o"
                    },
                    {
                        id: "90016",
                        text: "timeline",
                        url: "UI/timeline_iframe.html",
                        targetType: "iframe-tab",
                        icon: "fa fa-circle-o"
                    }
                ]
            },
            {
                id: "9002",
                text: "Forms",
                icon: "fa fa-edit",
                children: [
                    {
                        id: "90021",
                        text: "advanced",
                        url: "forms/advanced_iframe.html",
                        targetType: "iframe-tab",
                        icon: "fa fa-circle-o"
                    },
                    {
                        id: "90022",
                        text: "general",
                        url: "forms/general_iframe.html",
                        targetType: "iframe-tab",
                        icon: "fa fa-circle-o"
                    },
                    {
                        id: "90023",
                        text: "editors",
                        url: "forms/editors_iframe.html",
                        targetType: "iframe-tab",
                        icon: "fa fa-circle-o"
                    }
                ]
            }
        ];

    });
    setTimeout(function () {
        App.handleFullScreen()
    }, 1000);
    window.location = "/page/index.html?t=" + new Date();
    //    App.handleFullScreen()
</script>

</body>
</html>